package com.xsjl.qa.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xsjl.qa.pojo.Problem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * problem数据访问接口
 * @author Administrator
 *
 */
@Mapper
@Repository
public interface ProblemMapper extends BaseMapper<Problem> {

    @Select(value = "SELECT * from tb_problem LEFT JOIN tb_pl on id=problemid where labelid=#{labelId} ORDER BY replytime DESC")
    Page<Problem> newList(String labelId, Page<Problem> page);

    @Select(value = "SELECT * from tb_problem LEFT JOIN tb_pl on id=problemid where labelid=#{labelId} ORDER BY reply DESC")
    Page<Problem> hotList(String labelId, Page<Problem> page);

    @Select(value = "SELECT * from tb_problem LEFT JOIN tb_pl on id=problemid where reply=0 and labelid=#{labelId} ORDER BY createtime DESC")
    Page<Problem> waitList(String labelId, Page<Problem> page);



}
